package com.muyu.system.domain.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Administrator
 */
@Getter
@AllArgsConstructor
public enum AfterSalesStatusEnum {

    WAIT_SHOP(1,"商家处理中"),
    WAIT_RETURN(2,"寄回商品中"),
    WAIT_SHOP_RECEIVE(3,"商家收货"),
    WAIT_REFUND(4,"退款中"),
    REFUND_SUCCESS(5,"退款成功"),
    REFUND_FAIL(6,"退款失败");


    @EnumValue
    @JsonValue
    private final int code;

    private final String name;


    @JsonCreator
    public AfterSalesStatusEnum getAfterSalesStatusEnum(int code) {
        for (AfterSalesStatusEnum value : values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
